<div id="serviceList"> <!--ng-init="init()"-->
  <md-toolbar class="demo-toolbar md-primary _md _md-toolbar-transitions" id="found">
    <div class="md-toolbar-tools">
      <button class="md-button md-primary md-ink-ripple md-first-button" type="button"
              aria-label="Create Service" ui-sref="cp.addConfigFileSet({cfgSet:configFileSets})"
              style="padding:0 26px;background-color: #67aaf5;color:#fff"><span class="ng-scope">
                              创建配置
                            </span>
        <div class="md-ripple-container"></div>
        <md-tooltip md-direction="right">
          点击创建配置
        </md-tooltip>
      </button>
      <div class="col-lg-3 col-md-4 col-xs-5 search">
        <div class="input-group">
          <input type="text" class="form-control" placeholder="Search for..." ng-model="searchText">
          <span class="input-group-btn">
            <button class="btn btn-default" type="button" ng-click="searchClick()">
              <i class="fa fa-search"></i>
            </button>
          </span>
        </div>
      </div>
    </div>
  </md-toolbar>


  <!-- Responsive Table -->
  <div id="listPanelContainer" class="row">
    <div id="listPanel" class="col-md-12">

      <div class="panel-without-padding main_content">

        <div class="tabsdemoDynamicTabs" ng-cloak>

          <div class="demo-tab tab{{$index%4}}" style=" text-align: center;">


            <div class="table_mould">
              <div class="thead_mould" style="margin:22px 0">
                  <ul>
                      <li class="col-lg-3 col-md-2 col-xs-2"></li>
                      <li class="col-lg-3 col-md-3 col-xs-3"></li>
                      <li class="col-lg-3 col-md-3 col-xs-3"></li>
                      <li class="col-lg-3 col-md-4 col-xs-4"></li>
                  </ul>
              </div>
              <div class="tbody_mould">
                <ul ng-repeat="item in currentPageCfgSet " ng-click="openSubColumn=!openSubColumn"  ng-init="colIdx=$index" class="hover_animate " ng-class="{true:'open',false:''}[openSubColumn]" style="cursor: pointer">
                  <li class="col-lg-2 col-md-2 col-xs-2" style="height: 44px">
                    <div><p style="border-color: #64a8f8"></p></div>
                    <a href="" style="float: left;margin-left: 20px;"><i class="iconfont icon-wenjian" style="    margin-right: 10px;
    font-size: 18px;
    "></i>{{item.cfgMgrId}}</a>

                  </li>
                  <li class="col-lg-4 col-md-4 col-xs-4" >
                    配置版本：&nbsp;<span style="color:#27CA7B">{{item.versionList.length}}&nbsp;</span>个

                  </li>
                  <li class="col-lg-4 col-md-4 col-xs-4">

                    <button class="btn btn-default" type="submit" ng-click="addVersion($event,item)"><i class="iconfont icon-shanchu1 addIcon"></i>添加版本
                    </button>

                  </li>
                  <li class="col-lg-2 col-md-2 col-xs-2 table_btn">
                    <div>
                      <a href="" class="a1 aTag" ng-click="delCfgAllVer($event,item,$index)"  uib-tooltip="删除配置组"><i class="iconfont icon-remove" style="color:#FF9191"></i></a>
                      <a href="" class="a1 aTag"><i class="iconfont icon-dayu-gengduo" style=""></i></a>
                    </div>
                  </li>
                  <li class="col-lg-12 col-md-12 col-xs-12 subColumn open" style="cursor:auto">
                    <ul  ng-repeat="verItem in item.versionList">
                      <li class="col-lg-3 col-md-3 col-xs-3">
                        <a href="" style="float: left;margin-left: 25px;"><i class="iconfont icon-shijian" style="    margin-right: 10px;
    font-size: 18px;
    "></i>{{verItem.imgVersion}}</a>
                      </li>
                      <li class="col-lg-3 col-md-3 col-xs-3 table_btn" style="float:right">
                        <div>

                          <a href="" class="a1 aTag" ng-click="mgrCfgEnv(item.cfgMgrId,verItem.imgVersion,$event)" uib-tooltip="编辑变量组"><i class="iconfont icon-updateVar"></i></a>
                          <a ui-sref="cp.editConfigFileSet({cfs:{imageName:item.cfgMgrId,verItem:verItem,verList:item.versionList,isMarket:item.isMarket}})" class="a1 aTag"  uib-tooltip="编辑配置组"><i class="iconfont  icon-guanli" ></i></a>
                          <a href="" class="a1 aTag" ng-click="delCfgVer(item,$index,colIdx,$event)" uib-tooltip="删除变量"><i class="iconfont icon-shanchu" style="font-size: 20px;color:#FF9191"></i></a>
                        </div>
                      </li>
                    </ul>
                  </li>
                </ul>

              </div>


            </div>
            <!--<div ng-controller="TodoController">-->
            <div class="pull-right" ng-hide="searchPageHide">

              <ul uib-pagination
                  ng-model="currentPage"
                  total-items="configFileSets.length"
                  items-per-page="numPerPage"
                  max-size="3"
                  first-text="&laquo;"
                  previous-text="&lsaquo;"
                  next-text="&rsaquo;"
                  last-text="&raquo;"
                  boundary-links="true"
                  class="pagination-sm"
                  ></ul>

              <!--</div>-- >
            </div>


            <!--</div>-->
            </div>
          </div>
        </div>
      </div>

    </div>
  </div>
</div>
<!--配置组-->
<script type="text/ng-template" id="configurationVersion.html">
  <style>
    md-dialog.md-transition-in{
      max-width: 700px;
    }
  </style>
  <div class="modal-header modal_line" ng-init="modalChecked=true">

    <input type="checkbox" id="network"  class="chk_3" ng-click="modalChecked=!modalChecked" ng-model="network"style="float: right"/>
    <label for="network" style="float: right"></label>
    <!--<input type="checkbox" class="iswitch-lg iswitch-info"
           ng-click="modalChecked=!modalChecked" ng-model="network" style="float: right">-->
    <span style="float: right; line-height: 28px;margin-right: 10px;">开启后可编辑</span>

  </div>
  <div class="modal-body slider_modal overflowScoll" style="margin: 0 auto;width: 700px;padding-bottom: 0;color:#A9A9A9" ng-class="{true:'modalChecked',false:''}[modalChecked]">
    <div id="configCreateGroup">
      <div class="configGroup col-sm-4 col-xs-4 clearfix">
        <dl  style="width:150px">
          <dt style="text-align: center">变量组</dt>
          <dd class="active" style="border-color: #adadad;color:#333; background: #fff;">
            <div style="border-radius: 8px;border: 1px solid #64A8F8;width: 30px;height: 30px;    text-align: center; cursor: pointer   ; margin: 2px 0 0 -50px;float: left;" ng-click="newEnv()" ng-hide="modalChecked">
              <i class="" style="line-height: 30px;color: #64A8F8;font-size: 24px;margin-right: 2px;">+</i>
            </div>
            <form  style="position:relative;margin-bottom:15px ">
              <input type="text"  ng-blur="focus=false" ng-focus="focus=true" ng-model="curEnv.name" style="width: 100%" ng-disabled="modalChecked" name="svcinput" ng-pattern="svcnameReg">
              <small class="text-red ng-binding curVolumePath" ng-show="form.svcinput.$error.pattern">变量组不合法!请使用小写字母或数字</small>
            </form>
          </dd>
          <dd ng-class="activeSelected==$index?'active':''" ng-click="addClassActive($index,env)" ng-repeat="env in sub.envInfos" class="linePosition" >
            <div style=" cursor: pointer   ; margin: 2px 0 0 -49px;float: left;" ng-click="addEnv(curEnvInfo,activeSelected)">
              <i class="iconfont icon-shanchu" ng-show="!modalChecked" ng-click="removeSet($index)" style="line-height: 32px;color: #FD7056;font-size: 26px;"></i>
            </div>
            <input type="text" ng-model="env.name" ng-disabled="modalChecked" style="width: 100%">
          </dd>
          <!--<dd ng-class="select==$index?'active':''" ng-click="open($index,data.child)"ng-repeat="data in ThreeDate"><span>{{data.name}}</span></dd>
          <dd><span></span></dd>-->
        </dl>
        <div class="configLine"></div>

      </div>
      <div class="configCon col-sm-8 col-xs-8 clearfix">

        <div class="table_mould"  ng-show="$index==activeSelected&&focus===false" ng-repeat="data in sub.envInfos" style="padding: 0">
          <div class="thead_mould">
            <ul>
              <li class="col-sm-4 col-xs-4">变量内容</li>
              <li class="col-sm-4 col-xs-4">变量值</li>
              <li class="col-sm-4 col-xs-4"></li>
            </ul>
          </div>
          <div class="tbody_mould">
            <ul style="background: none"><!--ng-repeat="data in data1"-->
              <li class="col-sm-4 col-xs-4">
                <div class="col-sm-12 col-xs-12">
                  <input type="text" placeholder="变量名称" size="25" class="form-control" ng-model="curEnvInfo.name"  style="border:1px solid #adadad;" ng-disabled="modalChecked">
                </div>

              </li>
              <li class="col-sm-4 col-xs-4">
                <div class="col-sm-12 col-xs-12">
                  <input type="text" placeholder="变量值" size="25" class="form-control" ng-model="curEnvInfo.value" style="border:1px solid #adadad;" ng-disabled="modalChecked">
                </div>

              </li>
              <li class="col-sm-4 col-xs-4" >
                <div style="border-radius: 8px;border: 1px solid #64A8F8;width: 30px;height: 30px;    text-align: center; cursor: pointer   ; margin: 2px 0 0 24px; " ng-click="addEnv(curEnvInfo,activeSelected)" ng-hide="modalChecked">
                  <i class="" style="line-height: 30px;color: #64A8F8;font-size: 24px;margin-right: 2px;background: none;width: auto;height: auto">+</i>
                </div>
              </li>
            </ul>

            <ul style="background: none" ng-repeat="envInfo in data.info">
              <li class="col-sm-4 col-xs-4">
                <div class="col-sm-12 col-xs-12">
                  <input type="text" placeholder="变量名称" size="25" class="form-control"
                         ng-model="envInfo.name"  ng-disabled="modalChecked">
                </div>

              </li>
              <li class="col-sm-4 col-xs-4">
                <div class="col-sm-12 col-xs-12">
                  <input type="text" placeholder="变量值" size="25" class="form-control" ng-model="envInfo.value" ng-disabled="modalChecked">
                </div>

              </li>
              <li class="col-sm-4 col-xs-4">
                <i class="iconfont icon-shanchu" ng-show="!modalChecked" ng-click="deleteEnv($index)" style="line-height: 32px;color: #FD7056;font-size: 26px;margin-left: 26px;background: none;width: auto;height: auto;cursor:pointer"></i>
              </li>
            </ul>


          </div>
        </div>



      </div>
    </div>

  </div>
  <div class="modal-footer">
    <!--<button class="btn btn-info btnOpen" type="button" ng-hide="mountd" style="margin: 0 auto;display: block;padding: 7px 28px;;border-radius: 8px;">开启</button>-->

    <div>
      <div class="col-sm-6" style="">
        <button class="btn btn-info" type="button" ng-click="submit()" ng-hide="mountd"
                style="float: right;margin:0 15px;padding: 7px 28px;border-radius: 8px;">确定
        </button>
      </div>
      <div class="col-sm-6" style="float: right">
        <button class="btn btn-white" type="button" ng-click="cancel()"
                style="float: left;margin:0 15px;padding: 7px 28px;border-radius: 8px;">取消
        </button>
      </div>
    </div>
  </div>
</script>

<!--配置变量-->
<script type="text/ng-template" id="mirrorVersion.html">
  <style>
    md-dialog.md-transition-in{
      max-width: 70%;
    }
  </style>
  <div class="modal-header modal_line">





  </div>
  <div class="modal-body slider_modal" style="margin: 0 auto;width: 700px;padding-bottom: 0;color:#A9A9A9">
    <div style="    margin-left: 80px;">
      <div class="form-group " style="float: left;width: 40%;margin: 0"  >
        <label class="col-sm-3 control-label text-right" for="field-1">请选择镜像 <span
            class="required_text">*</span></label>

        <div class="col-sm-9">
          <select ng-model="sub.version" class="form-control" ng-options="spec for spec in specs"
                  ng-disabled="!(sub.curCluster!==undefined&&sub.curCluster.clusterId==='default')">
          </select>
        </div>
        <div class="clearfix"></div>


        <!--<label class="col-sm-2 control-label text-right" for="field-1">  <span class="required_text">*</span></label>

        <div class="col-sm-4">
          <md-select placeholder="" ng-model="sub.version"  style="margin:0 0" " >
          <md-option ng-value="tags" ng-repeat=" tags in imagesTags">{{imagesData.shortname}}:{{tags}}</md-option>
          </md-select>
        </div>

        <div class="clearfix"></div>-->

      </div>

      <div class="form-group"  style="float: right;width: 60%;margin: 0" ><!--ng-if="configFileSets.length>0"-->
        <label class="col-sm-2 control-label text-right" for="field-1">复制版本 <span
            class="required_text">*</span></label>

        <div class="col-sm-6">
          <select ng-model="sub.version" class="form-control" ng-options="spec for spec in specs"
                  ng-disabled="!(sub.curCluster!==undefined&&sub.curCluster.clusterId==='default')">
          </select>
        </div>
        <div class="col-md-2">
          <button class="btn btn-info btn-single" ng-click="copyVersion(FromVersion)" style="border-radius: 8px;padding:6px 16px"><!--<i class="fa-plus" ></i>-->复制
          </button>
        </div>

        <div class="clearfix"></div>
        <!--<label class="col-sm-2 control-label text-right">复制其他配置组 </label>
                <div class="col-md-6">
                  <md-select placeholder="" ng-model="FromVersion"  style="margin:0 0" " >
                  <md-option ng-value="tags" ng-repeat=" tags in configFileSets">{{tags.imageVersion}}</md-option>
                  </md-select>
                </div>
                <div class="col-md-4">
                  <button class="btn btn-info btn-single" ng-click="copyVersion(FromVersion)"><i class="fa-plus"></i>复制</button>
                </div>-->


      </div>

      <div class="form-group">
        <div style="width:40%;float:left" class="clearfix">
          <div class="col-sm-7" style="float: right">
            <input type="text" ng-required="string" ng-model="sub.command"
                   placeholder="/User/123" class="form-control">
          </div>
          <label class="col-sm-3 control-label text-right" for="field-1" style=";float: right">启动命令&nbsp;<span  class="required_text" style="color: #fff">*</span></label>


        </div>
        <div style="width:60%;float:right" class="clearfix">
          <div class="col-sm-2">
            <button class="btn btn-info btn-single" ng-click="addFile()" style="border-radius: 8px;padding:7px 16px"><!--<i class="fa-plus" ></i> -->添加文件</button>
          </div>
        </div>




        <div class="clearfix"></div>
      </div>
    </div>

    <div class="form-group" style="float:none">
      <div class="row listGrop_line" style="margin: 0 auto 5px;border-bottom-width:1px ">
        当前文件：<span>{{currentFile.filepath}}</span>
        <!-- <button class="btn btn-orange btn-single" ng-click="resetFile(currentFile)" style="float:right"><i
             class="fa-reply"></i>&nbsp;撤销更改
         </button>-->
      </div>
      <div class="row">
        <ul class="list-group " >

          <li class="list-group-item" ng-class="{active:currentFile==file}" ng-repeat="file in files track by $index"
              ng-click="editFile(file)" title="{{file.filepath}}">{{file.filepath}}<span style="float:right" class="configDelIcon"><i class="fa-remove delete-icon"
                                                                                                                                      ng-click="deleteFile(file)"></i></span>
          </li>

        </ul>
        <ui-codemirror ui-codemirror-opts="editorOptions" ng-model="currentFile.value" class="list-codemirror" ></ui-codemirror>
      </div>
      <div class="listGrop_line" style="border-top-width: 1px;margin:5px auto 0;height: 1px"></div>
    </div>

  </div>
  <div class="modal-footer">
    <!--<button class="btn btn-info btnOpen" type="button" ng-hide="mountd" style="margin: 0 auto;display: block;padding: 7px 28px;;border-radius: 8px;">开启</button>-->

    <div>
      <div class="col-sm-6" style="">
        <button class="btn btn-info" type="button" ng-hide="mountd"
                style="float: right;margin:0 15px;padding: 7px 28px;border-radius: 8px;">确定
        </button>
      </div>
      <div class="col-sm-6" style="float: right">
        <button class="btn btn-white" type="button" ng-click="cancel()"
                style="float: left;margin:0 15px;padding: 7px 28px;border-radius: 8px;">取消
        </button>
      </div>
    </div>
  </div>
</script>
<!--删除变量-->

<script type="text/ng-template" id="delConfigVar.html">
  <div class="modal-header modal_line">
    <!--<button type="button" class="close" data-dismiss="modal" aria-hidden="true" >&times;</button>-->
    <i class="iconfont icon-shanchu1" ng-click="cancel()"></i>

  </div>
  <div class="modal-body" id="modal-body" style="margin: 0 auto;width: 320px;height: 135px;
    " >
    <span style="display: block;text-align: center" >确定删除<strong class="ellipsis" style="min-width:20px;max-width:100px; display: inline-block;vertical-align: middle;font-weight: 400;color: rgba(255, 0, 0, 0.7);">{{cName}}</strong>变量吗?</span>
    <div class="modelIcon">
      <div class="delIconfont" ><i class="iconfont icon-cuowu"></i></div>
    </div>
  </div>

  <div class="modal-footer">
    <div>
      <div class="col-sm-6 col-xs-6" style="">
        <button class="btn btn-primary" type="button" ng-click="ok()"
                style="float: right;margin:0 10px;padding: 7px 28px;border-radius: 8px;">确定
        </button>
      </div>
      <div class="col-sm-6 col-xs-6" style="float: right">
        <button class="btn btn-default" type="button" ng-click="cancel()"
                style="float: left;margin:0 10px;padding: 7px 28px;border-radius: 8px;">取消
        </button>
      </div>
    </div>
  </div>

</script>
<!--删除配置组-->

<script type="text/ng-template" id="delConfigGroup.html">
  <div class="modal-header modal_line">
    <!--<button type="button" class="close" data-dismiss="modal" aria-hidden="true" >&times;</button>-->
    <i class="iconfont icon-shanchu1" ng-click="cancel()"></i>

  </div>
  <div class="modal-body" style="margin: 0 auto;width: 320px;height: 135px;
    " >
    <span style="display: block;text-align: center" >确定删除<strong class="ellipsis" style="min-width:20px;max-width:100px; display: inline-block;vertical-align: middle;font-weight: 400;color: rgba(255, 0, 0, 0.7);">{{cName}}</strong>整个配置组吗?</span>
    <div class="modelIcon">
      <div class="delIconfont" ><i class="iconfont icon-cuowu"></i></div>
    </div>
  </div>

  <div class="modal-footer">
    <div>
      <div class="col-sm-6 col-xs-6" style="">
        <button class="btn btn-primary" type="button" ng-click="ok()"
                style="float: right;margin:0 10px;padding: 7px 28px;border-radius: 8px;">确定
        </button>
      </div>
      <div class="col-sm-6 col-xs-6" style="float: right">
        <button class="btn btn-default" type="button" ng-click="cancel()"
                style="float: left;margin:0 10px;padding: 7px 28px;border-radius: 8px;">取消
        </button>
      </div>
    </div>
  </div>

</script>



